package com.wzh.design.newDesignPattern.strategy;

/**
 * @description:
 * @author: WZH
 * @time: 2022/3/24 9:40
 */
public class StrateDemo {

    public static void main(String[] args) {

        Strategy operationStrategy = new OperationMultiply();
        Strategy subtractStrategy = new OperationSubtract();

        Context context = new Context(operationStrategy);

        context.setStrategy(subtractStrategy);

        int i = context.executeStrategy(5, 8);

        System.out.println(i);
    }
}
